import Book.BookList;
import User.Administrator;
import User.OrdinaryUser;
import User.User;
import java.util.Scanner;

public class Main {
    public static User login (){
        System.out.println("请输入姓名：");
        Scanner scanner=new Scanner(System.in);
        String scan= scanner.nextLine();
        System.out.println("1>>普通用户"+" "+"2>>管理员");
        System.out.println("请输入身份：");
        int choise= scanner.nextInt();
        if(choise==1){
            return new OrdinaryUser(scan);
        }else {
            return new Administrator(scan);
        }
    }
    public static void main(String[] args) {
        BookList bookList=new BookList();
        while(true){
            User user=login();
        int choice=user.enu(user.name);
        user.Do(choice,bookList);
        }
    }
}